﻿@using Telerik.Web.Mvc.UI
@using MvcFront.Models

@model MvcFront.DB.UserGroup

@{
    ViewBag.Title = "Details";
}
    @Html.ValidationSummary(true)
<h2>Информация</h2>

<fieldset>
    <legend>Группа @Html.DisplayFor(model => model.FullGroupName)</legend>

    <div class="display-label">Полное имя группы</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.FullGroupName)
    </div>

    <div class="display-label">Имя группы</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.GroupName)
    </div>

    <div class="display-label">Менеджер группы</div>
    <div class="display-field">
        @string.Format("{1} {0} {2} ({3})", Model.Manager.FirstName, Model.Manager.SecondName, Model.Manager.LastName, Model.Manager.Login)
    </div>

    <div class="display-label">Статус</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.GroupStatusText)
    </div>
    <div class="display-label">Пользователи</div>
    @(Html.Telerik().Grid<UserAccountListViewModel>()
        .DataBinding(dataBinding => dataBinding.Ajax().Select("_GroupUsersList", "UserGroupList", new { groupId = Model.usergroupid }))
        .Name("UserAccountListGrid")
                   .Columns(columns =>
                   {
                       columns.AutoGenerate(column =>
                       {
                           column.Width = "150px";
                           if (column.Member == "UserId" || column.Member == "CompositeId")
                               column.Visible = false;
                       });
                   })
    ) 
</fieldset>
<p>
    @Html.ActionLink("Редактировать", "Edit", new { id=Model.usergroupid }) |
    @Html.ActionLink("Отмена", "Index")
</p>
